package hm3;

interface MediaPlayer{
    void play();
    void pause();
    void stop();
}

abstract class AbstractMediaPlayer implements MediaPlayer{
    @Override
    public void pause() {
        System.out.println("正在暂停播放器...");
    }

    @Override
    public void stop() {
        System.out.println("正在停止播放器...");
    }
}

class LocalMediaPlayer extends AbstractMediaPlayer{

    @Override
    public void play() {
        System.out.println("正在播放本地音乐...");
    }

}

class NetworkMediaPlayer extends AbstractMediaPlayer{

    @Override
    public void play() {
        System.out.println("正在从网络播放音乐...");
    }
}

public class MusicPlayerTest {
    public static void main(String[] args) {
        LocalMediaPlayer lp= new LocalMediaPlayer();
        NetworkMediaPlayer np = new NetworkMediaPlayer();
        lp.play();
        lp.pause();
        lp.stop();
        np.play();
        np.pause();
        np.stop();
    }
}
